Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix getElementBoundingBox() OOP version returning 6 numbers instead of a 2 vectors #305

Merged
merged 8 commits into from Aug 10, 2018

Conversation

Pirulax
Copy link
Contributor

@Pirulax Pirulax commented Aug 6, 2018

Small'n'Easy to test.
Fixes the OOP version of getElementBoudingBox.

  1. Now it returns 2 vectors if MinClientReqCheck passed
  2. Now it's available as a class variable too

@Pirulax
Copy link
Contributor Author

Pirulax commented Aug 6, 2018

Also, please see the header file, I left a comment there, please help me out with that :)

@@ -42,6 +42,7 @@ class CLuaElementDefs : public CLuaDefs
LUA_DECLARE(GetElementDimension);
LUA_DECLARE(GetElementZoneName);
LUA_DECLARE(GetElementBoundingBox);
LUA_DECLARE_OOP(GetElementBoundingBox);// Probably wrong, tell me how to declare the OOP version of this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok. You should remove LUA_DECLARE(GetElementBoundingBox) as LUA_DECLARE_OOP(GetElementBoundingBox) automatically does both. This duplicate declaration causes a compile error C2535.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll remove it.

@patrikjuvonen patrikjuvonen added this to In progress in release/v1.5.6 via automation Aug 6, 2018
@patrikjuvonen patrikjuvonen added the bug Something isn't working label Aug 6, 2018
@patrikjuvonen patrikjuvonen added this to the 1.5.6 milestone Aug 6, 2018
@@ -42,7 +42,6 @@ class CLuaElementDefs : public CLuaDefs
LUA_DECLARE(GetElementDimension);
LUA_DECLARE(GetElementZoneName);
LUA_DECLARE(GetElementBoundingBox);
LUA_DECLARE_OOP(GetElementBoundingBox);// Probably wrong, tell me how to declare the OOP version of this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you did it the other way around :)

Remove LUA_DECLARE(GetElementBoundingBox), keep LUA_DECLARE_OOP(GetElementBoundingBox).

For your reference, this is how they work:

#define LUA_DECLARE(x) static int x ( lua_State * luaVM );
#define LUA_DECLARE_OOP(x) LUA_DECLARE(x) LUA_DECLARE(OOP_##x)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, alright, thanks :)

@Addlibs
Copy link
Contributor

Addlibs commented Aug 6, 2018

I think the 510990e (min_mta_version tag in meta) solution is more elegant than a bool argument for legacy style

release/v1.5.6 automation moved this from In progress to Ready Aug 7, 2018
@patrikjuvonen
Copy link
Contributor

patrikjuvonen commented Aug 7, 2018

Reminder for committer: MIN_CLIENT_REQ_GETBOUNDINGBOX_OOP needs to be bumped before merge.

@patrikjuvonen patrikjuvonen moved this from Ready to In progress in release/v1.5.6 Aug 8, 2018
@qaisjp qaisjp merged commit 6ac18eb into multitheftauto:master Aug 10, 2018
release/v1.5.6 automation moved this from In progress to Done Aug 10, 2018
@qaisjp
Copy link
Contributor

qaisjp commented Aug 10, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants